class Solution {
public:
    string change_base(int n, int base) {
        string s = "";
        while (n) {
            s.push_back(n % base + '0');
            n /= base;
        }
        reverse(s.begin(), s.end());
        return s;
    }
    string convertDateToBinary(string date) {
        int y = stoi(date.substr(0, 4));
        int m = stoi(date.substr(5, 2));
        int d = stoi(date.substr(8, 2));
        string s1 = change_base(y, 2);
        string s2 = change_base(m, 2);
        string s3 = change_base(d, 2);
        return s1 + '-' + s2 + '-' + s3;
    }
};
